﻿@model IEnumerable<IRIS.Models.Staff>

@{
    ViewBag.Title = "Staff";
}

<h2>Starfsfólk</h2>

@section SubMenu
{
    <ul id="submenu">
        
        <li>@Html.ActionLink("Um Okkur", "UmOkkur", "AboutUs")</li>
        <li>@Html.ActionLink("Starfsfólk", "Staff", "AboutUs")</li>
        
    
    </ul>
}
 @if (User.IsInRole("Stjórnendur"))
            {
<p>
    @Html.ActionLink("Bæta við starfsmanni", "Create")
</p>
     }
<table>
    <tr>
        <th>
            Name
        </th>
        <th>
            Position
        </th>
        <th>
            Education
        </th>
        <th>
            Phone
        </th>
        <th>
            Email
        </th>
         @if (User.IsInRole("Stjórnendur"))
         {
        <th></th>
             }
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Position)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Education)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Phone)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Email)
        </td>
            @if (User.IsInRole("Stjórnendur"))
            {
        <td>
    
            @Html.ActionLink("Breyta", "Edit", new { id = item.ID, delete = "false" }) |            
            @Html.ActionLink("Eyða", "Edit", new { id = item.ID, delete = "true" })
            
        </td>
            }
    </tr>
}

</table>
